<!DOCTYPE html>
<html lang="zh_CN">

<head>
    <title>显示全图</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="图形系统开发实战:进阶篇 示例">
    <meta name="author" content="hjq">
    <meta name="keywords" content="canvas,anygraph,javascript">
    <!-- frame所需脚本和样式 -->
    <link rel="stylesheet" href="../../script/bootstrap-3.3.5/css/bootstrap.min.css">   
    <link rel="stylesheet" href="../../script/codemirror/codemirror.css">
    <script src="../../script/lib/jquery-1.11.2.min.js"></script>
    <script src="../../script/codemirror/codemirror_merge.js"></script>
    <!-- 加载代码块 -->
	<link rel="stylesheet" href="../css/styles.css">
    <script src="../js/helper.js"></script>
    <script>
        var pageTitle = "显示全图";
        var pageDesc = "初始显示范围为图形的全图。<br>实现要点：初始化图形对象时增加 fullView=true 选项即可";
    </script>

    <script type="module">
        import { Graph, VectorSource, Layer, BgUtil } from "../../src/index.js";

        // 初始化graph对象
        let graph = new Graph({
            "target": "graphWrapper",
            "fullView": true,
            "layers": [
                new Layer({
                    source: new VectorSource({
                        "fileUrl": "../../demo-data/geom.json"
                    }),
                    zIndex: 10010,
                    name: "数据层"
                })
            ]
        });

        // 显示辅助网格
        BgUtil.generateGrid(Object.assign({ "interval": 10, "graph": graph }, graph.getSize()));

        // 图形渲染
        graph.render();
    </script>
</head>

<body style="margin:10px;">
    <div id="graphWrapper" data-type="graph" style="width:100%; height:600px; border:solid 1px #CCC;"></div>
</body>

</html>